package com.group8.ge;

import java.util.Random;

import javax.swing.ImageIcon;

public class Enemy extends GameObject{
	private int id;
	private String name;
	private int direction;
	
	public Enemy(int x, int y, int d){
		direction = d;
		super.x = x;
		super.y = y;
		height = DEFAULT_HEIGHT_ENEMY;
		width = DEFAULT_WIDTH_ENEMY;
		img = new ImageIcon("assets/fly.png").getImage();
	}
	
	
	public void move() {
		if(direction == 0){
			setX(getX() + 1);
			if(getX() > 610)
				setX(0);
		}
		else{
			setX(getX() - 1);
			if(getX() < 0)
				setX(610);
		}
	}


	/* (non-Javadoc)
	 * @see java.lang.Runnable#run()
	 */
/*	@Override
	public void run() {
		
		while(this != null){
			move();
			try {
				Thread.sleep(50);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
		}
		
	}*/
}
